package com.han.spider.safecounty.entity;

import com.han.spider.safecounty.LevelEnum;
import com.han.spider.safecounty.TypeEnum;

import java.io.Serializable;
import java.util.Arrays;

/**
 * @Author: Hanjiafeng
 * @Date: 2020/5/23
 * @Desc: 行政区实体
 */
public class RegionEntity implements Serializable {

    /**
     * 行政区id
     */
    private int id;
    /**
     * 行政区名称
     */
    private String name;
    /**
     * 行政区级别
     */
    private LevelEnum levelEnum;
    /**
     * 有无直接设备
     */
    private TypeEnum typeEnum;
    /**
     * 父节点id
     */
    private Integer parentId;
    /**
     * 下一级节点数组
     */
    private Integer[] nextIds;
    /**
     * 当前行政区直接设备集合，一般只有庄下面有
     */
    private String[] deviceIds;
    /**
     * 层级编码
     */
    private String regionCode;

    public RegionEntity(int id, String name, LevelEnum levelEnum, TypeEnum typeEnum, Integer parentId, Integer[] nextIds, String[] deviceIds, String regionCode) {
        this.id = id;
        this.name = name;
        this.levelEnum = levelEnum;
        this.typeEnum = typeEnum;
        this.parentId = parentId;
        this.nextIds = nextIds;
        this.deviceIds = deviceIds;
        this.regionCode = regionCode;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public LevelEnum getLevelEnum() {
        return levelEnum;
    }

    public void setLevelEnum(LevelEnum levelEnum) {
        this.levelEnum = levelEnum;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer[] getNextIds() {
        return nextIds;
    }

    public void setNextIds(Integer[] nextIds) {
        this.nextIds = nextIds;
    }

    public String[] getDeviceIds() {
        return deviceIds;
    }

    public void setDeviceIds(String[] deviceIds) {
        this.deviceIds = deviceIds;
    }

    public TypeEnum getTypeEnum() {
        return typeEnum;
    }

    public void setTypeEnum(TypeEnum typeEnum) {
        this.typeEnum = typeEnum;
    }

    @Override
    public String toString() {
        return "RegionEntity{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", levelEnum=" + levelEnum +
                ", typeEnum=" + typeEnum +
                ", parentId=" + parentId +
                ", nextIds=" + Arrays.toString(nextIds) +
                ", deviceIds=" + Arrays.toString(deviceIds) +
                '}';
    }

    public String getRegionCode() {
        return regionCode;
    }

    public void setRegionCode(String regionCode) {
        this.regionCode = regionCode;
    }
}
